package com.ccb.jyzx.expand.tiantouonline.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author XIEFEI
 * @date 2019-11-18 16:02
 * @Description
 **/
public class CommonIdUtils {
    static final SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    private static final String FILE_PFIX = "TTO";
    private static final String BATCH_PFIX = "BTO";
    private static final String TAG_PFIX = "TAG";

    public static synchronized String createUUID() {
        String format = sf.format(new Date());
        return "".concat(format).concat(IDUtils.createNumId(12));
    }
    public static synchronized String createFileId() {
        String format = sf.format(new Date());
        return FILE_PFIX.concat(format).concat(IDUtils.createNumId(12));
    }


    public static synchronized String createBatchId() {
        String format = sf.format(new Date());
        return BATCH_PFIX.concat(format).concat(IDUtils.createNumId(12));
    }

    public static synchronized String createTagId() {
        String format = sf.format(new Date());
        return TAG_PFIX.concat(format).concat(IDUtils.createNumId(12));
    }
}
